#include "main/utils.h"
using namespace std;

void dfs(const vector<vector<int>>& graph,
         vector<int> &path,
         vector<vector<int>> &paths,
         int i) {
  path.push_back(i);
  if (i == graph.size() - 1) {
    paths.push_back(path);
  } else {
    for (auto next : graph[i]) {
      dfs(graph, path, paths, next);
    }
  }
  path.pop_back();
}

vector<vector<int>> allPath(const vector<vector<int>> &graph) {
  vector<vector<int>> paths;
  vector<int> path;
  dfs(graph, path, paths, 0);
  return paths;
}

int main() {
  vector<vector<int>> graph = {{1, 2}, {3}, {3}, {}};
  auto paths = allPath(graph);
  printVec("o110", paths);

  return 0;
}
